package com.mz.ozy.mvp.presenter;

import android.app.Activity;
import android.content.Context;

import com.mz.ozy.base.BasePresenterImpl;
import com.mz.ozy.bean.FriendBean;
import com.mz.ozy.bean.MyApplyMeetBean;
import com.mz.ozy.bean.MyApplyMeetResBean;
import com.mz.ozy.bean.MyBounsBean;
import com.mz.ozy.bean.MyBounsRecodeBean;
import com.mz.ozy.bean.PronotionBean;
import com.mz.ozy.mvp.model.MeModel;
import com.mz.ozy.mvp.view.ApplyMeetContract;
import com.mz.ozy.mvp.view.MyBonusContract;
import com.mz.ozy.net.MyObserver;
import com.mz.ozy.utils.RxUtil;

import okhttp3.ResponseBody;

public class ApplyMeetPresenter extends BasePresenterImpl<ApplyMeetContract.View> implements ApplyMeetContract.Presenter {

    private MeModel mModel;


    public ApplyMeetPresenter() {
        mModel = new MeModel();
    }

    @Override
    public void applyRes(Activity activity) {
        mModel.applyResMeet(activity)
                .compose(RxUtil.rxSchedulerHelper(mView.<ResponseBody>bindToLifecycle()))
                .subscribe(new MyObserver<MyApplyMeetBean>(mView) {
                    @Override
                    public void onSuccesss(MyApplyMeetBean myApplyMeetBean) {
                        mView.applyResSuccess(myApplyMeetBean);
                    }
                });
    }

    @Override
    public void apply(Activity activity) {
        mModel.applyMeet(activity)
                .compose(RxUtil.rxSchedulerHelper(mView.<ResponseBody>bindToLifecycle()))
                .subscribe(new MyObserver<MyApplyMeetResBean>(mView) {
                    @Override
                    public void onSuccesss(MyApplyMeetResBean s) {
                        mView.applySuccess(s);
                    }
                });
    }


}
